//
//  ChannelsSendingTester.h
//  GPUProcessingTesting
//
//  Created by kadlubek47 on 17.06.2013.
//  Copyright (c) 2013 kadlubek47. All rights reserved.
//

#ifndef __GPUProcessingTesting__ChannelsSendingTester__
#define __GPUProcessingTesting__ChannelsSendingTester__

#include <vector>

#include "OpenCLProcessorBase.h"
#include "Timer.h"

class ChannelsSendingTester: public OpenCLProcessorBase{
public:
    
    ChannelsSendingTester();
    ~ChannelsSendingTester();
    
    void manyChannels(float** channels, unsigned int channelsNum, unsigned int channelLength, float** destiny, double* timeOfCallCommandsFun, double* timeOfFlushAndFinish);
    
private:
    
    //Kernel
    static const char kernelPath_[];
    cl_kernel inOutKernel_;
    void createKernels();
    
    //Buffers
    std::vector<cl_mem> buffersIn_, buffersOut_;
    unsigned int channelsNum_ = 0;
    unsigned int channelLength_ = 0;
   
    //ManyChannel
    void createBuffersForChannels();
    void loadBlocksOfChannelsIntoGPU(float** channels);
    void executeKernel();
    void getBlocksOfChannelsFromGPU (float** destiny); 
};

#endif /* defined(__GPUProcessingTesting__ChannelsSendingTester__) */







